//
//  LoginView.m
//  UIProject-A
//
//  Created by lanou3g on 15/7/16.
//  Copyright (c) 2015年 何 旭. All rights reserved.
//

#import "LoginView.h"
#import "LTView.h"

@implementation LoginView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        NSArray *labelTextArray = @[@"用户名",@"密码"];
        NSArray *textFieldPlaceArray = @[@"请输入用户名",@"请输入密码"];
        for (int i = 0; i < 2; i++) {
            LTView *ltView = [[LTView alloc]initWithFrame:CGRectMake(50, 150 + 70 * i, 300, 35)];
            ltView.Label.text = labelTextArray[i];
            ltView.TextField.placeholder = textFieldPlaceArray[i];
            ltView.TextField.borderStyle = UITextBorderStyleRoundedRect;
            if (1 == i) {
                ltView.TextField.secureTextEntry = YES;
            }
            
            ltView.tag = 1000 + i;
            [self addSubview:ltView];
            
        }
        self.usernameView = (LTView *)[self viewWithTag:1000];
        self.passwordView = (LTView *)[self viewWithTag:1001];
       
            UIButton *lButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
            lButton.frame = CGRectMake(80, 300, 100, 40);
            [lButton setBackgroundImage:[UIImage imageNamed:@"login_button.png"] forState:UIControlStateNormal];
            [self addSubview:lButton];
        
        UIButton *rButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        rButton.frame = CGRectMake(210, 300, 100, 40);
        [rButton setBackgroundImage:[UIImage imageNamed:@"register_button.png"] forState:UIControlStateNormal];
        [self addSubview:rButton];
        lButton.tag = 2000;
            rButton.tag = 2001;
       }
        self.loginButton = (UIButton *)[self viewWithTag:2000];
        self.registButton = (UIButton *)[self viewWithTag:2001];
        
    
    return self;
}


    
    






















/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
